const rootUrl = ''
function get(url,data,callback){
	wx.request({
		url:rootUrl+url,
		data:data,
		header:{
			'content-type':'application/html'
		},
		success:(res)=>{
			return typeof callback == 'function' && callback(res.data)
		},
		fail:(res)=>{
			console.log(res);
		}
	})
}
function post(url,data,callback){
	wx.request({
		url:rootUrl+url,
		method:'POST',
		data:data,
		header:{
			'content-type':'application/x-www-form-urlencoded'
		},
		success:(res)=>{
			return typeof callback == 'function' && callback(res.data)
		},
		fail:(res)=>{
			console.log(res);
		}
	})
}
module.exports = {
	get:get,
	post:post
}